
// represents a Person with a user name and a list of buddies
class Person {

	String username;
	ILoBuddy buddies;

	Person(String username) {
		this.username = username;
		this.buddies = new MTLoBuddy();
	}

	// add the given person to this person's list of buddies
	void addBuddy(Person p){
		this.buddies = this.buddies.add(p);
	}

	// remove all buddies from the buddy list
	void removeAll(){
		this.buddies = new MTLoBuddy();
	}

	// returns true if this Person has that as a direct buddy
	boolean hasDirectBuddy(Person that) {
		return buddies.contains(that);
	}

	// returns the number of people who will show up at the party 
	// given by this person
	int partyCount(){
		return 1;
	}

	// Returns the number of people that are direct buddies 
	// of both this and that person
	int countCommonBuddies(Person that) {
		return this.buddies.filter(that.buddies).count();
	}

	// Will the given person be invited to a party 
	// organized by this person?
	boolean hasDistantBuddy(Person that) {
		return true;
	}

	// Compares the username and buddies of a Person.
	public boolean compareTo(Person that) {
		// Compares two people.
		return this.username.equals(that.username) && this.buddies.compareTo(that.buddies);
	}
}